﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace _1._7
{
    public partial class Form1 : Form
    {
        
        private readonly int maxWidth = 240, maxHeight = 180;
        private readonly int minWidth = 24, minHeight = 18;
        
        private readonly int widthStep = 24, heightStep = 18;

        public Form1()
        {
            InitializeComponent();
        }

       
        private void Form1_Load(object sender, EventArgs e)
        {
            pictureBox1.Size = new Size(maxWidth, maxHeight);
            btnEnlarge.Enabled = false;
            btnShrink.Enabled = true;
        }

       
        private void btnShrink_Click(object sender, EventArgs e)
        {
            int newWidth = pictureBox1.Width - widthStep;
            int newHeight = pictureBox1.Height - heightStep;

            pictureBox1.Size = new Size(newWidth, newHeight);
            btnEnlarge.Enabled = true; 
            
            if (newWidth <= minWidth && newHeight <= minHeight)
            {
                btnShrink.Enabled = false;
            }
        }

        
        private void btnEnlarge_Click(object sender, EventArgs e)
        {
            int newWidth = pictureBox1.Width + widthStep;
            int newHeight = pictureBox1.Height + heightStep;

            pictureBox1.Size = new Size(newWidth, newHeight);
            btnShrink.Enabled = true; 

            
            if (newWidth >= maxWidth && newHeight >= maxHeight)
            {
                btnEnlarge.Enabled = false;
            }
        }
    }
}